As an example of data transmission, optical transmission performed by a photocoupler has been known. In some cases where such optical transmission is performed, data is transmitted from a transmission side (a primary side) to a reception side (a secondary side) via a photocoupler, and a clock is transmitted from the reception side to the transmission side via another photocoupler.
In this case, if a transmission delay occurs during the data transmission using the photocoupler, etc., the transmission side and the reception side become asynchronous, so that a data error may occur at the reception side.
An embodiment of the present invention provides a semiconductor device in which the possibility of generating a data error at a reception side can be reduced even when a transmission side and the reception side are asynchronous.